package org.example.Test;

import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.example.Bean.Emp;
import org.junit.jupiter.api.Test;
import org.example.mapper.EmpMapper;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;
@Slf4j
@SpringBootTest
public class App {
    @Resource
    private EmpMapper empMapper;
    @Test
    public void a(){
        List<Emp> list=empMapper.findAll();
        for(Emp emp:list){
           log.info(emp.toString());
        }
    }
    @Test
    public void b(){
        Emp emp = new Emp();
        emp.setComm(9087.0);
        emp.setJob("程序员");
        emp.setMgr(8989);
        emp.setDeptNo(20);
        emp.setSal(9999.9);
        emp.setEname("bb");
        boolean b = empMapper.insert1(emp);
        log.info(String.valueOf(b));
    }
    @Test
    public void c(){
        Emp emp = new Emp();
        emp.setComm(9087.0);
        emp.setDeptNo(20);
        emp.setSal(9999.9);
        emp.setEmpNo(8010);
        boolean b = empMapper.update1(emp);
        log.info(String.valueOf(b));
    }
    @Test
    public void d(){
        boolean b = empMapper.update2(8035);
        log.info("b:{}",b);
    }
}
